package com.littcore.saap.message.po;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import java.io.Serializable;

/**
 * <br>
 * Table:user_message<br>
 * @author Hibernate Tools 3.4.0.CR1
 * @version 1.0
 * @since Nov 4, 2015 11:23:05 AM
 */
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true)
@Table(name = "user_message")
public class UserMessage implements Serializable {
	/**
	 * UID
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 序号.
	 */
	private Long id;

	/**
	 * 租户ID.
	 */
	private int tenantId;

	/**
	 * 模块编号.
	 */
	private String moduleCode;

	/**
	 * 消息编号.
	 */
	private String messageCode;

	/**
	 * 内容.
	 */
	private String content;
	
	/**
   * 是否弹窗.
   */
  private boolean popup;

	/**
	 * 创建时间.
	 */
	private Date createDatetime;

	/**
	 * 接收人.
	 */
	private int receiveBy;

	/**
	 * 是否已读.
	 */
	private boolean hasReceived;

	/**
	 * 接收时间.
	 */
	private Date receivedDatetime;

	public UserMessage() {
	}

	public UserMessage(int tenantId, String moduleCode,
			String messageCode, String content, Date createDatetime,
			int receiveBy, boolean hasReceived) {
		this.tenantId = tenantId;
		this.moduleCode = moduleCode;
		this.messageCode = messageCode;
		this.content = content;
		this.createDatetime = createDatetime;
		this.receiveBy = receiveBy;
		this.hasReceived = hasReceived;
	}

	public UserMessage(int tenantId, String moduleCode,
			String messageCode, String content, Date createDatetime,
			int receiveBy, boolean hasReceived, Date receivedDatetime) {
		this.tenantId = tenantId;
		this.moduleCode = moduleCode;
		this.messageCode = messageCode;
		this.content = content;
		this.createDatetime = createDatetime;
		this.receiveBy = receiveBy;
		this.hasReceived = hasReceived;
		this.receivedDatetime = receivedDatetime;
	}

	/**  
	 * Get 序号.
	 * @return 序号
	 */
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	/**
	 * Set 序号.
	 * @param id 序号
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**  
	 * Get 租户ID.
	 * @return 租户ID
	 */

	@Column(name = "TENANT_ID", nullable = false)
	public int getTenantId() {
		return this.tenantId;
	}

	/**
	 * Set 租户ID.
	 * @param tenantId 租户ID
	 */
	public void setTenantId(int tenantId) {
		this.tenantId = tenantId;
	}

	/**  
	 * Get 模块编号.
	 * @return 模块编号
	 */

	@Column(name = "MODULE_CODE", nullable = false, length = 50)
	public String getModuleCode() {
		return this.moduleCode;
	}

	/**
	 * Set 模块编号.
	 * @param moduleCode 模块编号
	 */
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}

	/**  
	 * Get 消息编号.
	 * @return 消息编号
	 */

	@Column(name = "MESSAGE_CODE", nullable = false, length = 50)
	public String getMessageCode() {
		return this.messageCode;
	}

	/**
	 * Set 消息编号.
	 * @param messageCode 消息编号
	 */
	public void setMessageCode(String messageCode) {
		this.messageCode = messageCode;
	}

	/**  
	 * Get 内容.
	 * @return 内容
	 */

	@Column(name = "CONTENT", nullable = false, length = 2000)
	public String getContent() {
		return this.content;
	}

	/**
	 * Set 内容.
	 * @param content 内容
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**  
	 * Get 创建时间.
	 * @return 创建时间
	 */

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATETIME", nullable = false, length = 19)
	public Date getCreateDatetime() {
		return this.createDatetime;
	}

	/**
	 * Set 创建时间.
	 * @param createDatetime 创建时间
	 */
	public void setCreateDatetime(Date createDatetime) {
		this.createDatetime = createDatetime;
	}

	/**  
	 * Get 接收人.
	 * @return 接收人
	 */

	@Column(name = "RECEIVE_BY", nullable = false)
	public int getReceiveBy() {
		return this.receiveBy;
	}

	/**
	 * Set 接收人.
	 * @param receiveBy 接收人
	 */
	public void setReceiveBy(int receiveBy) {
		this.receiveBy = receiveBy;
	}

	/**  
	 * Get 是否已读.
	 * @return 是否已读
	 */

	@Column(name = "HAS_RECEIVED", nullable = false)
	public boolean isHasReceived() {
		return this.hasReceived;
	}

	/**
	 * Set 是否已读.
	 * @param hasReceived 是否已读
	 */
	public void setHasReceived(boolean hasReceived) {
		this.hasReceived = hasReceived;
	}

	/**  
	 * Get 接收时间.
	 * @return 接收时间
	 */

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "RECEIVED_DATETIME", length = 19)
	public Date getReceivedDatetime() {
		return this.receivedDatetime;
	}

	/**
	 * Set 接收时间.
	 * @param receivedDatetime 接收时间
	 */
	public void setReceivedDatetime(Date receivedDatetime) {
		this.receivedDatetime = receivedDatetime;
	}

  
  /**
   * @return the popup
   */
	@Column(name = "POPUP", nullable = false)
  public boolean isPopup()
  {
    return popup;
  }

  
  /**
   * @param popup the popup to set
   */
  public void setPopup(boolean popup)
  {
    this.popup = popup;
  }

}
